********************************************************************************
* Balyuk, Berger, and Hackney (2024)                                           *
* "What is Fueling FinTech Lending? The Role of Banking Market Structure"      *
* The Review of Corporate Financial Studies                                    *
********************************************************************************

clear all
clear matrix

******************************   Table VI   ************************************

* open file *

	use "$code\DATA_Prosper_annual_county_w.dta", clear

* large bank lending *

	reghdfe large_bank2_P_l weighted_tier1_exp_large_l exam_small_l ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(fips year) cluster(fips)
	outreg2 using "$code\Table_VI.xls", ///
		replace stats(coef tstat) tdec(2) auto(2) bfmt(fc)
		
* small bank lending *

	reghdfe small_bank2_P_l exam_small_l weighted_tier1_exp_large_l ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(fips year) cluster(fips)
	outreg2 using "$code\Table_VI.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)			
	
* out-of-market bank lending *

	reghdfe out_100_P_l out_market_tier1_exp_l in_market_exam_l ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(fips year) cluster(fips)
	outreg2 using "$code\Table_VI.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)

* in-market bank lending *

	reghdfe in_100_P_l in_market_exam_l out_market_tier1_exp_l ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(fips year) cluster(fips)
	outreg2 using "$code\Table_VI.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)

* large out-of-market bank lending *

	reghdfe out_large2_100_P_l out_market_tier1_exp_large_l in_market_exam_small_l ///
		in_large2_100_P_l out_small2_100_P_l ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(fips year) cluster(fips)
	outreg2 using "$code\Table_VI.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
		
* small in-market bank lending *

	reghdfe in_small2_100_P_l in_market_exam_small_l out_market_tier1_exp_large_l ///
		in_large2_100_P_l out_small2_100_P_l ///
		bank_access_l deposits_l log_pop_l median_income_l unemployment_l ///
		house_price_chg_l eq_capital_ratio_l liquidity2gta_l ROA_l ///
		nonperf2loans_l ib6.rurality, ///
		absorb(fips year) cluster(fips)
	outreg2 using "$code\Table_VI.xls", ///
		append stats(coef tstat) tdec(2) auto(2) bfmt(fc)
